<template>
    <div class="search">
        <div class="searchtop">
            <van-icon @click="$router.go(-1)" name="arrow-left" />
            <van-search v-model="value" show-action  placeholder="请输入搜索关键词" @search="onSearch">
                <template #action>
                    <div @click="onSearch">搜索</div>
                </template>
            </van-search>
        </div>
        <router-view/>
    </div>
</template>

<script>
export default {
    data() {
        return {
            value: null,
        }
    },
    methods: {
        onSearch() {
            this.$router.push({ path: '/Search/SearchSort', query: { word: this.value } })
            this.value = '';
        }
    }
}
</script>

<style lang="scss" scoped>
.search{
    background-color: #ffffff;
    width: 100%;
    .searchtop{
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        background-color: #ffffff;
        .van-icon{
            background-color: #ffffff;
            line-height: 0.44rem;
            font-weight: 100;
            font-size: 0.3rem;
            height: 100%;
        }
        .van-search{
            flex: 1;
        }
    }
}
</style>